import type { TYPE, ValueLabelType } from '@/constants';
import { UploadListType } from 'antd/lib/upload/interface';

export type ComponentOptionsType = {
  mode?: 'multiple' | 'tags';
  options?: ValueLabelType[];
  valueString?: boolean;
  allowClear?: boolean;
  showSearch?: boolean;
  filterOption?: (input: any, option: any) => boolean;
  defaultValue?: string | number;
  // 上传相关开始
  type?: string;
  uploadTip?: string;
  listType?: UploadListType;
  accept?: string;
  // 上传相关结束
};

export type FieldType = {
  label: string;
  field: string;
  group: string;
  defaultSelected?: boolean;
  fixed?: boolean;
  editable?: boolean;
  noSelect?: boolean;
  tableShow?: boolean;
  type: TYPE;
  width?: number;
  showTooltipWhenOverflow?: boolean;
  className?: string;
  permission?: string;
  componentOptions?: ComponentOptionsType;
  format2Frontend?: any;
  format2Backend?: any;
  isNesscessary?: boolean;
};
